package com.example.loopyserver.server;

import com.example.loopyserver.dto.TaskDTO;
import com.example.loopyserver.exception.CommonException;
import org.springframework.cglib.core.internal.Function;

import java.util.Set;


public interface TaskService {
    <T> void push(String type, Object args, Class<T> resClass, int timeoutSeconds, Function<T, Boolean> callback);

    <T> T pushAndWaitDone(String type, Object args, Class<T> resClass, int taskTimeoutSeconds, int waitTimeoutSeconds, Function<T, Boolean> callback);

    TaskDTO pop(Set<String> acceptTypes) throws CommonException;

    void submit(String id, Object res) throws CommonException;
}
